﻿#pragma once
#include "pch.h"

class class_bars
{
	public:
		class_bars();
		~class_bars();

//初始化
void init();

//读
		int read(const std::filesystem::path &, int);

		//读tick
		int read_tick(const std::filesystem::path &,int );

		//读入文本类型
 	int	read_txt(const std::filesystem::path &,int );

//写出
	int write(const std::filesystem::path &,int );

//写出文本类型
	int write_txt(const std::filesystem::path &, int );



//插入tick
int insert(CThostFtdcDepthMarketDataField &);


//平均值
double average(int, int);


//获取最高
double highest(int ,int );

//获取最低
double lowest(int, int);


//标准差
double sigma(int,int);

//波动率
double bdl(int, int, int);

//数据容器
std::vector<struct_bar> datas;
//bar
struct_bar data;

std::mutex mutex0;
int flag;
int volume_old;
};

